package com.ww.java8.datetime;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.Month;

public class LocalDateTimeDemo {

    public static void main(String[] args) {
        LocalDateTime dt1 = LocalDateTime.of(2024, Month.FEBRUARY, 22, 0, 4, 0);
        System.out.println(dt1);

        LocalDate date = LocalDate.parse("2020-01-11");
        LocalTime time = LocalTime.parse("00:02:00");
        LocalDateTime dt2 = LocalDateTime.of(date, time);
        System.out.println(dt2);

        LocalDateTime dt3 = date.atTime(0, 2, 0);
        LocalDateTime dt4 = date.atTime(time);
        LocalDateTime dt5 = time.atDate(date);

        System.out.println(dt3);
        System.out.println(dt4);
        System.out.println(dt5);


    }
}
